import org.rsbot.script.methods.Bank;
import org.rsbot.script.methods.Inventory;
import org.rsbot.script.util.Timer;
import org.rsbot.script.wrappers.RSItem;

class VoluntaryThieve$Actions$12 extends VoluntaryThieve.Action
{
  Timer withdrawTimer;
  boolean hasDeposited;

  VoluntaryThieve.Action.State perform()
  {
    if (this.withdrawTimer == null)
      this.withdrawTimer = new Timer(this.this$1.this$0.random(1045, 1425));
    if (this.withdrawTimer.isRunning()) {
      return VoluntaryThieve.Action.State.PROGRESSING;
    }
    if (!VoluntaryThieve.access$7300(this.this$1.this$0).isOpen()) {
      return VoluntaryThieve.Action.State.FAILED;
    }
    if ((!this.hasDeposited) && (VoluntaryThieve.access$7400(this.this$1.this$0).getCount() > 0)) {
      this.hasDeposited = VoluntaryThieve.access$7500(this.this$1.this$0).depositAll();
    }
    RSItem localRSItem = VoluntaryThieve.access$7600(this.this$1.this$0).getItem(10075);
    if (localRSItem == null) {
      if (VoluntaryThieve.access$7700(this.this$1.this$0).close()) {
        this.this$1.this$0.log("Character is out of gloves of silence.");
        VoluntaryThieve.Actions.access$7802(this.this$1, false);
        return VoluntaryThieve.Action.State.COMPLETED;
      }return VoluntaryThieve.Action.State.PROGRESSING;
    }

    VoluntaryThieve.access$7900(this.this$1.this$0).withdraw(10075, 0);
    this.withdrawTimer = new Timer(this.this$1.this$0.random(2545, 2895));
    return VoluntaryThieve.Action.State.COMPLETED;
  }

  VoluntaryThieve.Action.State finish()
  {
    if (this.withdrawTimer.isRunning()) {
      if (VoluntaryThieve.access$8000(this.this$1.this$0).contains(10075))
        this.withdrawTimer.setEndIn(0L);
      else return VoluntaryThieve.Action.State.PROGRESSING;
    }

    if (VoluntaryThieve.access$8100(this.this$1.this$0).contains(10075)) {
      return VoluntaryThieve.access$8200(this.this$1.this$0).close() ? VoluntaryThieve.Action.State.COMPLETED : VoluntaryThieve.Action.State.PROGRESSING;
    }

    return VoluntaryThieve.Action.State.FAILED;
  }
}